<!--#
layout("/layouts/store.html"){
#-->
<script src="${base!}/assets/platform/vendor/iCheck/icheck.js"></script>
<style>
    table .s-input{margin: auto;}
    table,table.s-table tr td,table tr th{border: 1px solid #ddd;text-align: center;vertical-align: middle;}
</style>
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/store/order/delivery" id="goBack" data-pjax><i class="ti-angle-left"></i>${msg['globals.button.back']}</a>
    </div>
    <div class="pull-right">
    </div>
</header>

<div class="content-wrap bg-white">
    <div class="wrapper" style="min-height:500px;top:50px">
        <form id="createDeliveryForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
              action="${base}/store/order/delivery/saveOrderDelivery" method="post">
            <div class="panel-body">
                <div style="padding: 5px 0px" >
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h3 class="panel-title">买家信息</h3>
                        </div>
                        <input type="hidden" name="id" value="${obj.id}" >
                        <div class="panel-body">
                            <div class="col-md-10 col-md-offset-1">
                                <div class="col-md-4" style="padding: 5px 0px">
                                    用户名:   <span>${accountUser.loginname!}</span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    姓名:   <span>${accountUser.accountInfo.name!}</span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    手机号:   <span>${accountUser.mobile!}</span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    邮箱:   <span>${accountUser.email!}</span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    性别:   <span>${accountUser.accountInfo.sex!}</span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    生日:   <span>${accountUser.accountInfo.b_year!}-${accountUser.accountInfo.b_month!}-${accountUser.accountInfo.b_day!}</span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    星座:   <span>${accountUser.accountInfo.astro!}</span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    籍贯:   <span>${accountUser.accountInfo.nativePlace!}</span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    所在地:   <span> ${@area.getNameByCode(accountUser.accountInfo.provinceId!"0")} ${@area.getNameByCode(accountUser.accountInfo.cityId!"0")} ${@area.getNameByCode(accountUser.accountInfo.areaId!"0")} </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-success">
                        <div class="panel-heading">
                            <h3 class="panel-title">收货信息</h3>
                        </div>
                        <div class="panel-body">
                            <div class="col-md-10 col-md-offset-1">
                                <div class="col-md-4" style="padding: 5px 0px">
                                    收货人:   <span> ${obj.deliveryName} </span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    手机号:   <span> ${obj.deliveryMobile} </span>
                                </div>
                                <div class="col-md-4" style="padding: 5px 0px">
                                    电话:   <span> ${obj.deliveryPhone} </span>
                                </div>
                                <div class="col-md-12" style="padding: 5px 0px">
                                    收货地址 :   <span>${@area.getNameByCode(obj.deliveryProvince)} ${@area.getNameByCode(obj.deliveryCity)} ${@area.getNameByCode(obj.deliveryCounty)} ${obj.deliveryAddress}</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-info">
                        <div class="panel-heading">
                            <h3 class="panel-title">发货备注</h3>
                        </div>
                        <div class="panel-body">
                            <div class="col-md-12 col-md-offset-0">
                                <div class="col-md-12" style="padding: 5px 0px">
                                    <textarea class="form-control" name="remark" rows="3"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--#  var index= 1;  for(var order in orderList){ #-->
                    <div class="panel panel-danger">
                        <div class="panel-heading">
                            <h3 class="panel-title">订单信息${index}</h3>
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table s-table">
                                    <caption>订单号: ${order.id}   下单时间：<!--#if(!isEmpty(order.orderAt)){#-->${@date.getDate(order.orderAt)} <!--#}#-->
                                    </caption>
                                    <thead>
                                    <tr>
                                        <th>

                                        </th>
                                        <th>商品名称</th>
                                        <th>商城单价</th>
                                        <th>订单数量（个）</th>
                                        <th>发货数量（个）</th>
                                        <th>未发货数量（个）</th>
                                        <th>发货时间</th>
                                        <th>小计</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <!--#for(o in order.goodsList ){  var noSendNum = o.buyNum - o.sendNum; #-->
                                    <tr style="border-bottom: 1px solid #dfe6ec;">
                                        <td>
                                            <input type="checkbox" class="hy-check check-cell" name="check" checked  disabled value="${o.id}" />
                                        </td>
                                        <td>${o.goodsName} ${o.name}</td>
                                        <td>￥${@money.fenToYuan(o.buyPrice)}</td>
                                        <td>${o.buyNum} </td>
                                        <td>
                                            ${o.sendNum}
                                        </td>
                                        <td>${noSendNum}</td>
                                        <td>当日发货</td>
                                        <td>￥${@money.fenToYuan(o.totalMoney)}</td>
                                    </tr>
                                    <!--#}#-->
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!--# index++; } #-->
                </div>
            </div>
        </form>

    </div>
</div>

<!--确认创建配货单 【确认】-->
<div class="modal fade" id="dialogCreate" tabindex="-1" role="dialog" aria-labelledby="dialogCreateModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="dialogCreateModalLabel">创建确认</h4>
            </div>
            <div class="modal-body">
                <span>您确认要创建配货单吗？</span><br>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="receipt"  data-dismiss="modal">确认</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<script>

</script>
<!--#}#-->